<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>

<html>
<head>
<head lang="en">
    <meta charset="UTF-8">
    <%@include file="style.jsp" %>
    <%@include file="script.jsp" %>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/orderlang/distributor/css/company_profile.css"/>
    <title>基础资料设置</title>   
</head>
<body style='overflow:-Scroll;overflow-x:hidden'>
<input type="hidden"  id="hcityID" value="${distributor.cityID }">
<input type="hidden" id="hprovinceID" value="${distributor.provinceID }">
<div id="tipMsg"></div>
<div id="container_1" >
    <div>
        <%@include file="header.jsp" %>
    </div>
    <div id="content" class="clearfix">
        <%@include file="left_menu.jsp" %>
        <div class="right-content" style="margin:75px 20px 0 213px;">
            <p class="brand">
                <a href="#">设置</a>><a href="#" class="now">基础资料设置</a>
            </p>
            <div class="center-content" >
                <div class="fix">
                    <a class="submit" onclick="baseSet()">保存</a>
                    <a class="cancel" onClick="javascript :history.back(-1);">取消</a>
                </div>
                <div class="message">
                    <h4>公司信息</h4>
                    <div class="clearfix fl" style="width:100%;">
                        <div class="fl" style="width:50%;">
                            <div class="company-name clearfix">
                                <p>
                                    <span style="width:88px;display:inline-block;text-align:right;"><i>*</i>公司名称</span>
                                    <input name="did" id="id" type="hidden"  value="${distributor.id}"/>
                                    <input name="name" id="name" type="text" maxlength="20" placeholder="请输入公司名称(最多20字)" value="${distributor.name}"/>
                                </p>
                            </div>
                            <div class="company-name clearfix">
                                <p>
                                    <span style="width:88px;display:inline-block;text-align:right;"><i>*</i>所属行业</span>
                                    <input name="industry" id="industry"  type="text" placeholder="请输入所属行业" value="${distributor.industry}"/>
                                </p>
                            </div>
                            <div class="name clearfix">
                                <p>
                                    <span style="width:88px;display:inline-block;text-align:right;"><i>*</i>订货平台名称</span>
                                    <input name="systemName" id="systemName"  type="text"  maxlength="20" placeholder="将显示在客户端logo旁" value="${distributor.systemName}"/>
                                </p>
                            </div>

             <div class="addr-content clearfix">
               <div class="fl"  style="width:88px;display:inline-block;text-align:right;"><i>*</i>联系地址</div>
                    <select data-placeholder="省份" name="province" id="provinceId" class="province" data-rel="chosen">
	                        <option value="${province.provinceid}">选择省份</option>
	                </select>
                   <select data-placeholder="城市" name="city" id="cityId" class="city" data-rel="chosen">
	                   <option value="${province.cityId}">选择城市</option>
	               </select>
            </div>
           <input type="text" id="address" name="address" value="${distributor.address}" class="all-addr fl" placeholder="请输入详细地址"/>
         </div>
         
         <div class="right-side fl">
            <div class="logo">
                 <h5>logo上传</h5>
                 <div class="ibox-content" style="display: inline-block">
                     <div class="row">
                         <div id="crop-avatar" class="col-md-6">
                             <div class="avatar-view">
                                 <img src="${distributor.photoHref}" alt="Logo">
                             </div>
                         </div>
                     </div>
                 </div>
                
                 <div class="modal fade" id="avatar-modal" aria-hidden="true"
                      aria-labelledby="avatar-modal-label" role="dialog" tabindex="-1">
                     <div class="modal-dialog modal-lg">
                         <div class="modal-content">
                             <form class="avatar-form" action="${pageContext.request.contextPath}/distributor/logoUpload"
                                   enctype="multipart/form-data" method="post">
                                 <div class="modal-header">
                                     <button class="close" data-dismiss="modal"
                                             type="button">&times;</button>
                                     <h4 class="modal-title" id="avatar-modal-label">选择公司LOGO</h4>
                                 </div>
                                 <div class="modal-body">
                                     <div class="avatar-body">
                                         <div class="avatar-upload">
                                             <input value="${distributor.id}" name=id type="hidden">
                                             <input class="avatar-src" name="avatar_src" type="hidden">
                                             <input class="avatar-data" name="avatar_data" type="hidden">
                                             <input class="avatar-input" id="avatarInput"
                                                    name="avatar_file" type="file">
                                         </div>
                                         <div class="row">
                                             <div class="col-md-9">
                                                 <div class="avatar-wrapper"></div>
                                             </div>
                                             <div class="col-md-3">
                                                 <div class="avatar-preview preview-lg"></div>
                                                 <div class="avatar-preview preview-md"></div>
                                                 <div class="avatar-preview preview-sm"></div>
                                             </div>
                                         </div>
                                         <div class="row avatar-btns">
                                             <div class="col-md-3">
                                                 <button class="btn btn-success btn-block avatar-save"
                                                         type="submit"><i class="fa fa-save"></i> 保存修改
                                                 </button>
                                             </div>
                                         </div>
                                     </div>
                                 </div>
                             </form>
                         </div>
                     </div>
                 </div>
             </div>
             
             <div class="connect-name clearfix fl"  style="width:50%;">
                 <p>
                     <i>*</i>联系人
                     <input name="contact" id="contact" type="text" value="${distributor.contact}"/>
                 </p>
             </div>
             <div class="phone clearfix fl"  style="width:50%;">
                 <p>
                     <i>*</i>手机
                     <input name="tel"  id="tel"  type="text" value="${distributor.tel}"/>
                 </p>
             </div>
             <div class="mail fl">
                 <p>
                     邮箱
                     <input name="email" id="email" type="email" value="${distributor.email}"/>
                 </p>
             </div>
         </div>
                    </div>
                    <div class="company-intro fl" style="width:100%;">
                        <h5>公司介绍</h5>
                        <div class="img" id="imgdiv">
                            <img id="imgupload" src="${pageContext.request.contextPath}/img/gongsitup_03.jpg"/>
                        </div>
                        <div class='little'>
                        <c:if test="${not empty photoList }">
                        		<c:forEach items="${photoList}" var="photo">
                         		<div class="img-upload">
		                         		<c:if test="${photo.sortNum eq 1}">
			                         		<!-- 点击图片，打开文件选择器，确定，上传。 -->  
											<img id="upload1" alt="" style="width: 112px; height: 68px" src="${pageContext.request.contextPath}${photo.photoHref}" />  
											<input id="imgSrc1" name="idCardPicSrc1" value="" style="display: none" />
		                         		</c:if>
		                            </div>
		                            <div class="img-upload">
		                             <c:if test="${photo.sortNum eq 2}">
		                                  <!-- 点击图片，打开文件选择器，确定，上传。 -->  
										<img id="upload2" alt="" style="width: 112px; height: 68px" src="${pageContext.request.contextPath}${photo.photoHref}" />  
										<input id="imgSrc2" name="idCardPicSrc1" value="" style="display: none" />
		                             </c:if>
		                            </div>
		                            <div class="img-upload">
		                                <!-- 点击图片，打开文件选择器，确定，上传。 -->  
		                                <c:if test="${photo.sortNum eq 3}">
		                                   <img id="upload3" alt="" style="width: 112px; height: 68px" src="${pageContext.request.contextPath}${photo.photoHref}" />  
										   <input id="imgSrc3" name="idCardPicSrc1" value="" style="display: none" />
		                                </c:if>
		                            </div>
		                            <div class="img-upload">
		                                 <c:if test="${photo.sortNum eq 4}">
		                                         <!-- 点击图片，打开文件选择器，确定，上传。 -->  
												<img id="upload4" alt="" style="width: 112px; height: 68px" src="${pageContext.request.contextPath}${photo.photoHref}" />  
												<input id="imgSrc4" name="idCardPicSrc1" value="" style="display: none" />
		                               </c:if>
		                            </div>
		                            <div class="img-upload">
				                            <c:if test="${photo.sortNum eq 5}">
				                                  <!-- 点击图片，打开文件选择器，确定，上传。 -->  
												 <img id="upload5" alt="" style="width: 112px; height: 68px" src="${pageContext.request.contextPath}${photo.photoHref}" />  
												 <input id="imgSrc5" name="idCardPicSrc1" value="" style="display: none" />
				                            </c:if>
		                            </div>
		                         </c:forEach>
                        </c:if>
                        <c:if test="${empty photoList }">
                         	 <div class="img-upload">
			                         		<!-- 点击图片，打开文件选择器，确定，上传。 -->  
											<img id="upload1" alt="" style="width: 112px; height: 68px" src="${pageContext.request.contextPath}/img/plus_07.jpg" />  
											<input id="imgSrc1" name="idCardPicSrc1" value="" style="display: none" />
		                            </div>
		                            <div class="img-upload">
		                                  <!-- 点击图片，打开文件选择器，确定，上传。 -->  
										<img id="upload2" alt="" style="width: 112px; height: 68px" src="${pageContext.request.contextPath}/img/plus_07.jpg" />  
										<input id="imgSrc2" name="idCardPicSrc1" value="" style="display: none" />
		                            </div>
		                            <div class="img-upload">
		                                <!-- 点击图片，打开文件选择器，确定，上传。 -->  
		                                   <img id="upload3" alt="" style="width: 112px; height: 68px" src="${pageContext.request.contextPath}/img/plus_07.jpg" />  
										   <input id="imgSrc3" name="idCardPicSrc1" value="" style="display: none" />
		                            </div>
		                            <div class="img-upload">
		                                         <!-- 点击图片，打开文件选择器，确定，上传。 -->  
												<img id="upload4" alt="" style="width: 112px; height: 68px" src="${pageContext.request.contextPath}/img/plus_07.jpg" />  
												<input id="imgSrc4" name="idCardPicSrc1" value="" style="display: none" />
		                            </div>
		                            <div class="img-upload">
				                                  <!-- 点击图片，打开文件选择器，确定，上传。 -->  
												 <img id="upload5" alt="" style="width: 112px; height: 68px" src="${pageContext.request.contextPath}/img/plus_07.jpg" />  
												 <input id="imgSrc5" name="idCardPicSrc1" value="" style="display: none" />
		                            </div>
                        </c:if>
                        </div>
	                        <div class="txt">
                        <input type="hidden" name="remarkContent" id="remarkContent" value="${distributor.remark}"/>
                        <c:if test="${distributor.remark == ''}">
                        	<script id="remark" name="remark" type="text/plain"
                                    style="width: 100%;height:300px;">
                             </script>
                        </c:if>
                        <c:if test="${distributor.remark != ''}">
                          <script id="remark" name="remark" type="text/plain"
                                    style="width: 100%;height:300px;">
                          </script>
                        </c:if>
                        </div>
                    </div>
                </div>
                
                <div class="caiwu">
                    <h4>财务信息</h4>
                    <div class="left-block fl">
                        <p>
                            开户名称
                            <input type="text" placeholder="请输入开户名称" name="accountName" id="accountName" value="${distributor.accountName}"/>
                        </p>
                        <p>
                            开户银行
                            <input type="text" placeholder="请输入开户行银行名称" name="bank" id="bank"  value="${distributor.bank}"/>
                        </p>
                        <p>
                            纳税人识别号
                            <input type="text" placeholder="请输入纳税人识别号" name="taxpayerIdNum" id="taxpayerIdNum"  value="${distributor.taxpayerIdNum}"/>
                        </p>
                    </div>
                    <div class="right-block fl">
                        <p>
                            银行账号
                            <input type="text" placeholder="请输入银行账号" name="account" id="account" value="${distributor.account}"/>
                        </p>
                        <p>
                            发票抬头
                            <input type="text" placeholder="请输入发票抬头" name="invoiceTitle" id="invoiceTitle" value="${distributor.invoiceTitle}"/>
                        </p>
                    </div>
                </div>
                <div class="kefu">
                    <h4>客服设置</h4>
                    <div class="clearfix">
                        <p class="fl">
                            电话:
                            <input type="text" placeholder="请输入公司电话" name="serviceTel" id="serviceTel" value="${distributor.serviceTel}"/>
                        </p>
                        <p class="fl">
                           微信:
                            <input type="text" placeholder="请输入微信" name="wechat" id="wechat" value="${distributor.wechat}"/>
                        </p>
                        <p class="fl">
           QQ号
                            <input type="text" placeholder="请输入QQ号" name="qq" id="qq" value="${distributor.qq}"/>
                        </p>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="${pageContext.request.contextPath}/static/orderlang/distributor/js/company_profile.js"></script>
</body>
</html>